package com.lizemin.inputoutput.filter;

import lombok.extern.slf4j.Slf4j;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;

/**
 * @author lzm
 * @date 2025/4/5 10:41
 * @description
 */
@WebFilter("/*")
@Slf4j
public class Bfilter implements Filter {

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        log.info("进入了B过滤器...");
        String encoding = request.getCharacterEncoding();
        String respEncode = response.getCharacterEncoding();
        log.info("请求编码为：{},响应编码为：{}", encoding, respEncode);
        chain.doFilter(request, response);
        log.info("这是B过滤器放行请求后的代码...");
    }
}
